on btnSound asoundName -- does a little validation
if stringp(asoundName) and asoundName <> "Silence" then
puppetSound asoundName
end if
end
on getBehaviorDescription
return "- Click Behavior -"¨
& return & "Defined: controls a dual-image button."¨
& return & "Intended Use: to give user a simple audio + visual feedback that they've engaged a control. Rolling off button during mouseDown will disengage."¨
& return & return & "- Properties -"¨
& return & "Down Sound: assigns a mouseDown button sound."¨
& return & "Up Sound: assigns a mouseUp button sound."¨
& return & "MouseUp Action: assigns a button course of action."¨
& return & " (Note: Select 'None' if you plan to add a seperate mouseUp behavior to this button)"¨
& return & "Destination Marker: assigns a destination to the course of action."¨
& return & return & "(Explore the 'LookHere' folder on the CD-Rom for examples of each behavior)"
end
--- the handler code ---
on click downSound, upSound
set emem = the membernum of sprite clickon()
if stringP(downSound) then btnSound downSound
updatestage
set the membernum of sprite clickon() = emem + 1
updatestage
repeat while the stillDown or soundBusy (1)
if rollover( clickon() ) then set the membernum of sprite clickon() = emem + 1 -- added Apple legal code
else set the membernum of sprite clickon() = emem
updateStage
end repeat
if stringP(upSound) and rollover( clickon()) then btnSound upSound